package com.shigen.demo.pattern.factory;

/**
 * @author shigenfu
 * @date 2023/10/7 12:58 下午
 */
public class Factory {

    public static Product createProduct(String type) {
        if ("A".equals(type)) {
            return new ProductA();
        } else if ("B".equals(type)) {
            return new ProductB();
        }
        return null;
    }

}
